var ZHONGCHIDU={
	mod:{
		main:null
	},
	reloadData:null,
	init:function(){
		var _this = this;
		_this.mod.main.init();
		_this.reloadData = _this.mod.main._reloadData;
	}
};

var imgs =[
           	{"src":"nuanfeng","title":"暖锋",selfdisabled:'all',style:'color:#FF0000',type:'WORM',selfDefineStyle:'shixian', id:'wormClick' ,title:'暖锋',selfdefinewidth:'2',selfdisabled:'all'},	
           	{selfdisabled:'all',"src":"jingzhifeng",style:'color:#0000FF',type:'JZF',selfDefineStyle:'shixian',id:'jzfClick',title:'静止锋',selfdefinewidth:'2'},	
           	{"src":"lengfeng",'selfdisabled':'all',style:'color:#0000FF',type:'COLD',selfDefineStyle:'shixian',id:'coldClick',title:'冷锋',typeTrue:'LENGFENG',selfdisabled:'all',selfdefinewidth:'2'},
           	{"src":"guqiufeng",selfdisabled:'all',style:'color:#FF0000',type:'GQF',selfDefineStyle:'shixian',id:'gqfClick',title:'锢囚锋',selfdefinewidth:'2'},	 
           	{"src":"guoqu12h_nf",selfdisabled:'all',style:'color:#FFFF00',typeTrue:'GQWORM',type:'WORM',selfDefineStyle:'shixian',id:'gqsexsnfClick',title:'过去12小时暖锋',selfdefinewidth:'2'},
           	{"src":"guoqu12h",selfdisabled:'all',style:'color:#FFFF00',type:'COLD',typeTrue:'GQCOLD',selfDefineStyle:'shixian',id:'gqsexslfClick',title:'过去12小时冷锋',selfdefinewidth:'2'},	
           	{"src":"12h_xzswq",style:'color:#FF8000',selfDefineStyle:'shixian',type:'SSX',typeTrue:'SEXSXZJWQ',id:'sexsxzjwqClick',title:'12小时显著降温区',selfdisabled:'SelfStyleColorAndWidth',selfdefinewidth:'1'},	
           	{"src":"24h_bgx",style:'color:#0000FF',selfDefineStyle:'shixian',type:'SSX',typeTrue:'SXSBGX',id:'essxsbgxClick',title:'24小时变高线',selfdisabled:'SelfStyleColorAndWidth',selfdefinewidth:'2'},	
           	{"src":"ganshe",style:'color:#FF8000',selfDefineStyle:'shixian',type:'SSX',typeTrue:'GANSHE',id:'ganSheClick',title:'干舌',selfdefinewidth:'2',selfdisabled:'SelfStyleColorAndWidth'},	
           	{"src":"dengbishixian",style:'color:#008000',selfDefineStyle:'dandianxuxian',id:'dbsxClick',type:'BEZIER_CURVE',selfdisabled:'SelfStyle',title:'等比湿线','selfdefinewidth':'3'},
           	{"src":"dengfengsuxian",style:'color:#808080',selfDefineStyle:'shixian',id:'dfsxClick',type:'BEZIER_CURVE',selfdefinestyle:'shixian',selfdefinewidth:'2',selfdisabled:'SelfStyle',typeTrue:'DENGFENGSUXIAN',title:'等风速线'},
           	{"src":"dengludianwendu",style:'color:#008000', selfDefineStyle:'dianxian', id:'dldwdxClick',type:'BEZIER_CURVE',typeTrue:'DLDWDX',selfdisabled:'SelfStyle',title:'等露点温度线',selfdefinewidth:'2'},	
           	{"src":"bz_caoxian",style:'color:#A52A2A',selfDefineStyle:'shixian',type:'ECTVALUE_LINE',id:'dbzdcxClick',selfdisabled:'SelfStyle',title:'带标注的槽线',selfdefinewidth:'2'},
           	{"src":"3h_xzjy",style:'color:#0080FF',selfDefineStyle:'changxuxian',id:'sxsxzjyxClick',type:'BEZIER_CURVE',selfdisabled:'SelfStyle',title:'3小时显著降压线',selfdefinewidth:'2'},	
           	{"src":"3h_xzsy",style:'color:#FF69B4',selfDefineStyle:'changxuxian',id:'sxsxzsyxClick',type:'BEZIER_CURVE',selfdefinestyle:'changxuxian',selfdefinewidth:'2',selfdisabled:'SelfStyle',title:'3小时显著升压线'},
           	{"src":"5feng",style:'color:#FF8000',id:'fxg',title:'风向杆',type:'WIND',selfdisabled:'all'},	
           	{"src":"8feng",style:'color:#FF8000',selfdisabled:'all' ,type:'WIND',id:'qibajifeng',title:'七至八级风'},	 
           	{"src":"24h_bwq",style:'color:#00B4FF' ,id:'essxsbw', type:'SSX',typeTrue:'ESSXSBW',title:'24小时变温',selfdefinewidth:'2',selfdisabled:'SelfStyleColorAndWidth'},	
           	{"src":"850hPaAnd5000h",style:'color:#FF8000',selfDefineStyle:'changxuxian',id:'bawuwenducha',type:'BEZIER_CURVE',title:'850与500hPa温度差',selfdisabled:'SelfStyle',selfdefinewidth:'4'},
           	{"src":"deng_jxdww",style:'color:#FF0000', selfDefineStyle:'changxuxian',id:'djxdwwxClick' ,type:'BEZIER_CURVE' ,typeTrue:'DJXDWWZ',selfdisabled:'SelfStyle',title:'等假相当位温线',selfdefinewidth:'3'},
           	
           	{"src":"dengyaxian",style:'color:#00B4FF',selfDefineStyle:'shixian',id:'dyxClick',type:'BEZIER_CURVE',typeTrue:'DENGYAXIAN',selfdefinewidth:'2',selfdefinestyle:'shixian',selfdisabled:'SelfStyle',title:'等压线'},	
           	{"src":"fuhexian",style:'color:#00B4FF',selfDefineStyle:'shixian',id:'fuhexianClick',title:'辐合线',type:'GQF',typeTrue:'FUHEXIAN',selfdefinewidth:'2' ,selfdisabled:'SelfStyleColorAndWidth'},	
           	{"src":"25aPh_jjwdtzx",style:'color:#008000',selfDefineStyle:'shixian',id:'jjwdtzxClick',title:'250hPa季节温度特征线',type:'SSX',typeTrue:'EWPAJIWDTZX',selfdefinewidth:'3',selfdisabled:'SelfStyleColorAndWidth'},	
           	{"src":"dengwenduxian",style:'color:#FF0000',selfDefineStyle:'shixian',id:'dwdxClick',type:'BEZIER_CURVE',typeTrue:'DENGWENDUXIAN',selfdisabled:'SelfStyle',title:'等温度线',selfdefinewidth:'2'},
           	 
           	{"src":"caoxian",selfdisabled:'all',style:'color:#A52A2A',selfDefineStyle:'shixian',type:'BEZIER_CURVE' ,typeTrue:'CAOXIAN' ,id:'caoxianClick',title:'槽线' ,selfdefinewidth:'2'},
           	{"src":"xianzhuliuxian",style:'color:#0000FF',selfDefineStyle:'shixian',id:'xzlxClick',title:'显著流线',selfdisabled:'SelfStyleColorAndWidth',type:'DXJT',typeTrue:'xzlx',selfdefinewidth:'2'},	
           	{"src":"zhexian",style:'color:#0000FF',selfDefineStyle:'shixian',id:'zhexianClick' ,type:'POLYLINE',typeTrue:'ZHEXIAN',selfdisabled:'SelfStyle',title:'折线', selfdefinewidth:2},
           	{"src":"xianzhushiqu",style:'color:#008000',selfDefineStyle:'changxuxian',type:'BEZIER_CURVE',selfdisabled:'SelfStyle' ,id:'xzsqClick',title:'显著湿区',selfdefinewidth:'2'},	
           	
           	{"src":"ganxian",style:'color:#00B4FF',selfDefineStyle:'shixian',type:'SSX',typeTrue:'GANXIAN',id:'ganxianClick',title:'干线',selfdisabled:'SelfStyleColorAndWidth',selfdefinewidth:'2'},
           	{"src":"gq12hcaoxian",style:'color:#FFFF00',selfDefineStyle:'changxuxian',type:'BEZIER_CURVE',typeTrue:'GQSEXSCX',id:'gqsexscxClick',selfdisabled:'SelfStyle',title:'过去12小时槽线',selfdefinewidth:'3'},
           	{"src":"gq12hqbx",style:'color:#FFFF00',selfDefineStyle:'shixian',id:'gqsexsqbxClick',type:'BEZIER_CURVE',typeTrue:'GQSEXSQIEBIANXIAN',selfdisabled:'SelfStyle',title:'过去12小时切变线',selfdefinewidth:'3'},	
           	{"src":"jiliuhe",style:'color:#FF0000',selfDefineStyle:'shixian',type:'SSX',typeTrue:'JILIUHE',id:'jiliuheClick',title:'急流核',selfdefinewidth:'2',selfdisabled:'SelfStyleColorAndWidth'},	           	
           	{"src":"lengcao",style:'color:#00B4FF',id:'lengcaoClick',type:'SSX',typeTrue:'LENCAO',title:'冷槽',selfdefinewidth:'2',selfdisabled:'SelfStyleColorAndWidth'},
           	{"src":"qiebianxian",style:'color:#00B4FF',id:'qiebianxianClick',type:'SSX',typeTrue:'SHUANGSHIXIAN',title:'切变线',selfdefinewidth:'2',selfdisabled:'SelfStyleColorAndWidth'},	
           	{"src":"longjuanfeng",selfdisabled:'all' ,style:'color:#FF0000',type:'POINT',id:'longjuanfeng',title:'龙卷风'},
           	{"src":"maxfengdai",style:'color:#0000FF',selfDefineStyle:'shixian',id:'zdfdClick',title:'最大风带',type:'DXJT',typeTrue:'zdfd' ,selfdefinewidth:'4',selfdisabled:'SelfStyleColorAndWidth'},	
           	{"src":"bz_24hcaoxian",style:'color:#A52A2A',selfDefineStyle:'changxuxian',type:'ECTVALUE_LINE',id:'dbzdwlessxscClick',selfdisabled:'SelfStyle',title:'带标注的未来24小时槽',selfdefinewidth:'2'},	
           	{"src":"shizhou",style:'color:#008000',selfDefineStyle:'shixian',id:'shizhouClick' ,title:'湿轴',type:'GQF',typeTrue:'SHIZHOU',selfdefinewidth:'2',selfdisabled:'SelfStyleColorAndWidth'},	
           	{"src":"paoxian",style:'color:#00B4FF',selfDefineStyle:'shuangdianxuxian',type:'BEZIER_CURVE',id:'biaoxianClick',title:'飑线',selfdisabled:'SelfStyle',selfdefinewidth:'2'},
           	{"src":"shishe",style:'color:#008000',selfDefineStyle:'shixian',type:'SSX',typeTrue:'SHISHE',id:'shisheClick',title:'湿舌',selfdisabled:'SelfStyleColorAndWidth',selfdefinewidth:'2'},
           	{"src":"wenduji",style:'color:#00B4FF',selfDefineStyle:'shixian',type:'SSX',typeTrue:'WENDUJI',id:'wdjClick',title:'温度脊',selfdisabled:'SelfStyleColorAndWidth',selfdefinewidth:'2'},
           	{"src":"yanweixian",style:'color:#EA00EB',selfDefineStyle:'shixian',type:'SSX',typeTrue:'yanwei',id:'yanweiClick',title:'直角燕尾线',selfdisabled:'SelfStyleColorAndWidth',strokeColor:''},
           	{"src":"junbiao",style:'color:#EA00EB',selfDefineStyle:'shixian',type:'SSX',typeTrue:'junbiao',id:'junbiaoClick',title:'斜角燕尾线',selfdisabled:'SelfStyleColorAndWidth',strokeColor:''},
           	{"src":"zhijiaoyanwei",style:'color:#EA00EB',selfDefineStyle:'shixian',type:'SSX',typeTrue:'zhiJiaoyanwei',id:'zhiJiaoyanweiClick',title:'直角箭头',selfdisabled:'SelfStyleColorAndWidth',strokeColor:''},
           	{"src":"zhijiaojunbiao",style:'color:#EA00EB',selfDefineStyle:'shixian',type:'SSX',typeTrue:'zhiJiaojunbiao',id:'zhiJiaojunbiaoClick',title:'斜角箭头',selfdisabled:'SelfStyleColorAndWidth',strokeColor:''},
           	{"src":"chuizhisudu",style:'color:#0000ff',selfDefineStyle:'shixian',type:'SSX',typeTrue:'WEIDINGYI1',id:'weidingyi1Click',title:'垂直速度',selfdisabled:'SelfStyleColorAndWidth',selfdefinewidth:'2'}
           	]; 

ZHONGCHIDU.mod.main = {
		_reloadData:null,
		init:function(){
			var _this = this;
			_this.initTable();
		},
		initTable:function(){
			var _this = this;
			_this.initTop();
			$(".div-bottom div").bind("click",function(){
                debugger
				$(".div-bottom div").css("background-color","");
				$(".div-bottom div").css("background-image","");
				$(this).css("background-color","#3d597c");
				//小图片恢复原来的样式
				$(".zcditem_zcd div").css("background-color","");
				var clazz = $(this).attr("class");
				var url = "http://10.226.120.112:8091/business/common/css/images/zcd/";
				if(clazz == "hand_1"){
					$(this).css("background-image","url("+url+"hand02.png) ");
				}else if(clazz == "hand_2"){
					$(this).css("background-image","url("+url+"copy02.png) ");
				}else if(clazz == "hand_2_update"){
					$(this).css("background-image","url("+url+"update02.png) ");
				}else if(clazz == "hand_3"){
					$(this).css("background-image","url("+url+"move02.png) ");
				}else if(clazz == "hand_4"){
					$(this).css("background-image","url("+url+"trash02.png) ");
				}else if(clazz == "hand_5"){
					$(this).css("background-image","url("+url+"erase02.png) ");
				}else if(clazz == "hand_6"){
					$(this).css("background-image","url("+url+"back02.png) ");
				}else if(clazz == "hand_7"){
					$(this).css("background-image","url("+url+"next02.png) ");
				}
			});
			//GIS.Common.deactiveTool();
		},
		//画上面部分的图片
		initTop:function(){
			//window.top.map=myMap;
			var html = "";
			for(var i =0;i<imgs.length;i++){
				var src = 'http://10.226.120.112:8091/business/common/css/images/zcd/'+imgs[i].src+".png";
                debugger
				var $div = $('<div></div>').attr(imgs[i]).on('click',function(){
                    debugger
					var $this = $(this);
					$(".zcditem_zcd div").css("background-color","");
					$this.css("background-color","#445364");
					//drawSvgGis.svg.tianqizhongchiObj1 =$this;
					//小助手恢复原来的样式  互斥
					$(".div-bottom div").css("background-color","");
					$(".div-bottom div").css("background-image","");
					$('#toolArea').children('div').css("background-image","").css("background-color","");
					$this.addClass("after");
					//GIS.Common.deactiveTool();
					//drawSvgGis.svg.scaleClick(this,function(data){
						//zcdShowModal(data);
				//	});
                    scaleClick(this);
					$('.selWram').attr('title',this.title);
					changeColorAndText($this);
					judgeFontAndThickness($this);
					$("#space").attr('data-flag','0');
					$("#juli").attr('data-flag','0');
				});
				 str = $div.attr('style',$div.attr('style')+';'+'background-image: url('+src+')'+';'+'background-position:center center');
				$(".zcditem_zcd").append($div);
			}
			
			function changeColorAndText($obj){
				var color = $obj.css('color');
				color= Raphael.color(color).hex;
				$('.scale_color').prop('value',color); 
				$('#selWram').html($obj.attr('title'));
			}
			function judgeFontAndThickness($obj){
				var style1='width: 101%;position:absolute;height: 101%;z-index: 9999;background-color: rgba(168, 168, 148, 0.32)';
				var style2 = 'display:none';
				if($obj.attr('selfdisabled')=='all'){
					$('#eleDetail_warp_zhezhao').attr('style',style1);
				}else{ 
					$('#eleDetail_warp_zhezhao').attr('style',style2);
				}
				if($obj.attr('selfdisabled')=='SelfStyleColorAndWidth'){
					$("#svgselect").attr('disabled','disabled');
				}
				else
				{
					if($("#svgselect").attr('disabled'))
					{
						$("#svgselect").removeAttr('disabled');
					}	
				}
			}
			$('.div-bottom').find('div').on('click',function(){
                debugger
				var $this =$(this);
//				drawSvgGis.svg.scaleClick(this);
				$('.selWram').attr('title',this.title);
//				GIS.Common.deactiveTool();
				changeColorAndText($this);
				judgeFontAndThickness($this);
				$("#space").attr('data-flag','0');
				$("#juli").attr('data-flag','0');
			});
		}
	
};

	function zcdShowModal($obj){
		var isE = $('#modal_zcdShowModal').length;
		var ifShow =$('#modal_zcdShowModal').css("display");
		if(ifShow=="none" || ifShow === undefined){
			if(isE<=0){
				$.modal.show({
					id : "zcdShowModal",// modalId
					title : "中尺度图例",// 弹出框标题
					m_top : 200,//上边距
					m_bottom : 200,//下边距
					m_left : 484,//右边距
					width : 220,// 弹出框宽度
					height : 300,// 弹出框宽度
					hide: true,
					backdrop : false,// 是否遮罩
					closeTip : true,// 是否需要关闭按钮
					size : 'small'
				});
			}
			$('#modal_zcdShowModal').css("display","block");
		}
		$("#modal_zcdShowModal .modal-body").empty();
		if(!($obj==null || $.isEmptyObject($obj))){
			for(var i in $obj){
				var src = 'http://10.226.120.112:8091/business/common/css/images/zcd/'+$obj[i].src+".png";
				var isF = $('#modal_zcdShowModal .modal-body div[title='+i+']').length;
				if(isF<=0){
					var html = '<div title='+i+' style="width:101px;height:28px;overflow: hidden;float:left;margin:4px 0;">';
					html += '<img src='+src+' style="float: left;width:24px;height:24px;margin: 2px;">';
					html += '<span style="float: left;width:65px;height:24px;overflow-x:hidden; margin: 2px;text-overflow: ellipsis;white-space: nowrap;">'+i+'</span></div>';
					$("#modal_zcdShowModal .modal-body").append(html);
				}
			}
		}else{
			$('#modal_zcdShowModal').css("display","none");
		}
	}
	
	function zcdClean(){
		$("#modal_zcdShowModal .modal-body").empty();
		$('#modal_zcdShowModal').css("display","none");
	}